//
//  Config.m
//  zxvisa
//
//  Created by very good on 15/4/17.
//  Copyright (c) 2015年 caiguo. All rights reserved.
//

#import "Config.h"
#import  <objc/runtime.h>
NSString * EXTERN_SHIPKEY;
NSString * EXTERN_MMSI;
NSString * EXTERN_PHONENUMBER;
@implementation Config
+(void)navgationBackitem:(UIViewController *)sender{
    //设置导航栏底图
    [sender.navigationController.navigationBar setBackgroundImage:[Tool headbg] forBarMetrics:UIBarMetricsDefault];
    [sender.view setBackgroundColor:[Tool getBackgroundColor]];
    //定制导航栏左按钮
    UIImage* image1= [UIImage imageNamed:@"back"];
    CGRect frame_1= CGRectMake(0, 0, image1.size.width, image1.size.height);
    UIButton* btnBack= [[UIButton alloc] initWithFrame:frame_1];
    [btnBack setBackgroundImage:image1 forState:UIControlStateNormal];
    //   [btnBack setTitle:@"返回" forState:UIControlStateNormal];
    [btnBack setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    btnBack.titleLabel.font=[UIFont systemFontOfSize:16];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
    [btnBack addTarget:sender action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem * BarButtonItem= [[UIBarButtonItem alloc] initWithCustomView:btnBack];
    sender.navigationItem.leftBarButtonItem = BarButtonItem;
    __block UINavigationController *navigationController =sender.navigationController;
    if (![sender respondsToSelector:@selector(back)]) {
        IMP back = imp_implementationWithBlock(^{
               [navigationController popViewControllerAnimated:YES];
        });
        class_addMethod([sender class], @selector(back), back, "v@");
 #pragma clang diagnostic pop
        
    }
}

#pragma mark - 去掉多余的线
+(void)tableViewClearExtraLine:(UITableView *)tableView {
    UIView *view = [[UIView alloc] init];
    view.backgroundColor = [UIColor clearColor];
    [tableView setTableFooterView:view];
}
#pragma mark - 线条从头开始
+(void)tableViewLineFromHeader:(UITableView *) tableView{
    if ([tableView respondsToSelector:@selector(setSeparatorInset:)]) {
        
        [tableView setSeparatorInset:UIEdgeInsetsZero];
        
    }
    if ([tableView respondsToSelector:@selector(setLayoutMargins:)]) {
        
        [tableView setLayoutMargins:UIEdgeInsetsZero];
        
    }
}



@end
